<extend name="Base/ucenter_common"/>
<block name="body">
    <div id="zj-bh-search">
        <style>
            .form {
                margin-top: 30px;
            }

        </style>
        <div class="widget-box">
            <div class="widget-header">
                <h3>成绩查询：</h3>
            </div>
            <div class="widget-body">
                <form class="form form-inline" action="{:U('user/my_grade')}" method="post"
                      name="ey-change-form">
                    <div class="form-group">
                        <label class="control-label">查询背号</label>
                        <input class="form-control" type="text" placeholder="背号" maxlength="10"
                               name="team_name" value="{$_caption.team_name}" v-model="bh_id">
                    </div>
                    <div class="form-group">
                        <button type="button" @click="search();" class="btn btn-success btn-block">查询</button>
                    </div>
                </form>
            </div>
        </div>
        <div class="widget-box">
            <div class="widget-header">
                <h3>查询结果：</h3>
            </div>
            <div class="widget-body">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>背号</th>
                        <th>成绩</th>
                        <th></th>
                        <th></th>
                        <th></th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
    <script>
        new Vue({
            el: '#zj-bh-search',
            data: {bh_list: [], bh_id: ''},
            methods: {
                search: function () {
                    var bh_id = this.$data.bh_id;
                    $.post("{:U('User/my_grade')}", {bh_id: bh_id}, function (ret) {
                        console.log(ret);
                        if (ret.length <= 0) {
                            layer.msg('未查询到背号数据');
                        }
                    });
                }
            }
        });
    </script>
</block>